Optimal. Leaf size=69 \[ \frac {2 a \, _2F_1\left (\frac {1}{2},1-n;\frac {3}{2};1+\sec (e+f x)\right ) (-\sec (e+f x))^{-n} \sec ^{1+n}(e+f x) \sin (e+f x)}{f \sqrt {a-a \sec (e+f x)}} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.05, antiderivative size = 69, normalized size of antiderivative = 1.00, number of steps
used = 3, number of rules used = 3, integrand size = 24, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.125, Rules used = {3891, 69, 67}
\begin {gather*} \frac {2 a \sin (e+f x) (-\sec (e+f x))^{-n} \sec ^{n+1}(e+f x) \, _2F_1\left (\frac {1}{2},1-n;\frac {3}{2};\sec (e+f x)+1\right )}{f \sqrt {a-a \sec (e+f x)}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 67
Rule 69
Rule 3891
Rubi steps
\begin {align*} \int \sec ^n(e+f x) \sqrt {a-a \sec (e+f x)} \, dx &=-\frac {\left (a^2 \tan (e+f x)\right ) \text {Subst}\left (\int \frac {x^{-1+n}}{\sqrt {a+a x}} \, dx,x,\sec (e+f x)\right )}{f \sqrt {a-a \sec (e+f x)} \sqrt {a+a \sec (e+f x)}}\\ &=\frac {\left (a^2 (-\sec (e+f x))^{-n} \sec ^{1+n}(e+f x) \sin (e+f x)\right ) \text {Subst}\left (\int \frac {(-x)^{-1+n}}{\sqrt {a+a x}} \, dx,x,\sec (e+f x)\right )}{f \sqrt {a-a \sec (e+f x)} \sqrt {a+a \sec (e+f x)}}\\ &=\frac {2 a \, _2F_1\left (\frac {1}{2},1-n;\frac {3}{2};1+\sec (e+f x)\right ) (-\sec (e+f x))^{-n} \sec ^{1+n}(e+f x) \sin (e+f x)}{f \sqrt {a-a \sec (e+f x)}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] Result contains complex when optimal does not.
time = 0.52, size = 222, normalized size = 3.22 \begin {gather*} \frac {2^{-\frac {1}{2}+n} e^{-\frac {1}{2} i (e+f (1+2 n) x)} \left (\frac {e^{i (e+f x)}}{1+e^{2 i (e+f x)}}\right )^{\frac {1}{2}+n} \left (1+e^{2 i (e+f x)}\right )^{\frac {1}{2}+n} \csc \left (\frac {e}{2}+\frac {f x}{2}\right ) \left (e^{i f n x} (1+n) \, _2F_1\left (\frac {n}{2},\frac {1}{2}+n;\frac {2+n}{2};-e^{2 i (e+f x)}\right )-e^{i (e+f (1+n) x)} n \, _2F_1\left (\frac {1}{2}+n,\frac {1+n}{2};\frac {3+n}{2};-e^{2 i (e+f x)}\right )\right ) \sqrt {a-a \sec (e+f x)}}{f n (1+n) \sqrt {\sec (e+f x)}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [F]
time = 0.08, size = 0, normalized size = 0.00 \[\int \left (\sec ^{n}\left (f x +e \right )\right ) \sqrt {a -a \sec \left (f x +e \right )}\, dx\]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \sqrt {- a \left (\sec {\left (e + f x \right )} - 1\right )} \sec ^{n}{\left (e + f x \right )}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int \sqrt {a-\frac {a}{\cos \left (e+f\,x\right )}}\,{\left (\frac {1}{\cos \left (e+f\,x\right )}\right )}^n \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________